package remoto;

import interfaces.IFHotelController;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public abstract class Cliente {
	
	private static IFHotelController fachada;

	public Cliente() {
	
	}
	
	public static IFHotelController getInstance(){
		
		if(fachada==null){
			try {
				Registry registro = LocateRegistry.getRegistry(8888);
				fachada = (IFHotelController) Naming.lookup("rmi://localhost:8888/servicos");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return fachada;
	}
	
}
